package com.computer.subscribe.mapper;

import com.computer.subscribe.pojo.TSubscribe;
import com.computer.subscribe.pojo.TSubscribeExample;

import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface TSubscribeMapper {
	/**
	 * 根据机房编号+指定的预约状态,计算其收到的预约数量
	 * 
	 * @param subscribeStatus
	 * @param roomNUm
	 * @return
	 */
	Integer getCountIdByStatusAndRoom(
			@Param("subscribeStatus") Integer subscribeStatus,
			@Param("roomNum") Integer roomNum);

	/**
	 * 根据申请人学号,计算其所有预约的数量
	 * 
	 * @param applicant
	 * @return
	 */
	Integer getCountByApplicant(@Param("applicant") Long applicant);

	/**
	 * 计算某位申请者指定时间内的预约申请总行数
	 * 
	 * @param timeBegin
	 * @param timeEnd
	 * @param applicant
	 * @return
	 */
	Integer selectCountsByApplicantAndTime(@Param("timeBegin") String timeBegin,
			@Param("timeEnd") String timeEnd, @Param("applicant") Long applicant);

	/**
	 * 分页查询某位申请者的全部预约单
	 * 
	 * @param timeBegin
	 * @param timeEnd
	 * @param offset
	 * @param rows
	 * @param applicant
	 * @return
	 */
	List<TSubscribe> selectByApplicantAndLimit(@Param("offset") Integer offset,
			@Param("rows") Integer rows, @Param("applicant") Long applicant);

	/**
	 * 在某个时间范围内分页查询某位申请者的全部预约单
	 * 
	 * @param timeBegin
	 * @param timeEnd
	 * @param offset
	 * @param rows
	 * @param applicant
	 * @return
	 */
	List<TSubscribe> selectByTimeApplicantLimit(@Param("timeBegin") String timeBegin,
			@Param("timeEnd") String timeEnd, @Param("offset") Integer offset,
			@Param("rows") Integer rows, @Param("applicant") Long applicant);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to
	 * the database table t_subscribe
	 *
	 * @mbggenerated Sun Apr 11 13:28:41 CST 2021
	 */
	int countByExample(TSubscribeExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to
	 * the database table t_subscribe
	 *
	 * @mbggenerated Sun Apr 11 13:28:41 CST 2021
	 */
	int deleteByExample(TSubscribeExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to
	 * the database table t_subscribe
	 *
	 * @mbggenerated Sun Apr 11 13:28:41 CST 2021
	 */
	int deleteByPrimaryKey(Long id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to
	 * the database table t_subscribe
	 *
	 * @mbggenerated Sun Apr 11 13:28:41 CST 2021
	 */
	int insert(TSubscribe record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to
	 * the database table t_subscribe
	 *
	 * @mbggenerated Sun Apr 11 13:28:41 CST 2021
	 */
	int insertSelective(TSubscribe record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to
	 * the database table t_subscribe
	 *
	 * @mbggenerated Sun Apr 11 13:28:41 CST 2021
	 */
	List<TSubscribe> selectByExample(TSubscribeExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to
	 * the database table t_subscribe
	 *
	 * @mbggenerated Sun Apr 11 13:28:41 CST 2021
	 */
	TSubscribe selectByPrimaryKey(Long id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to
	 * the database table t_subscribe
	 *
	 * @mbggenerated Sun Apr 11 13:28:41 CST 2021
	 */
	int updateByExampleSelective(@Param("record") TSubscribe record,
			@Param("example") TSubscribeExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to
	 * the database table t_subscribe
	 *
	 * @mbggenerated Sun Apr 11 13:28:41 CST 2021
	 */
	int updateByExample(@Param("record") TSubscribe record,
			@Param("example") TSubscribeExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to
	 * the database table t_subscribe
	 *
	 * @mbggenerated Sun Apr 11 13:28:41 CST 2021
	 */
	int updateByPrimaryKeySelective(TSubscribe record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to
	 * the database table t_subscribe
	 *
	 * @mbggenerated Sun Apr 11 13:28:41 CST 2021
	 */
	int updateByPrimaryKey(TSubscribe record);
}